#include "../Include/WhimsyNetworkPropertyVisitor.hpp"

namespace Whms
{
    namespace Network
    {
        namespace Property
        {
            namespace Visitor
            {
                namespace Base
                {
                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Int8::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Int8::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Int8::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Int16::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Int16::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Int16::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Int32::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Int32::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Int32::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Int64::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Int64::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Int64::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::UInt8::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::UInt8::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::UInt8::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::UInt16::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::UInt16::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::UInt16::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::UInt32::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::UInt32::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::UInt32::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::UInt64::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::UInt64::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::UInt64::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Real32::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Real32::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Real32::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Real64::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Real64::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Real64::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Vec2::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Vec2::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Vec2::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Vec3::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Vec3::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Vec3::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::Vec4::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::Vec4::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::Vec4::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::IntVec2::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::IntVec2::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::IntVec2::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::IntVec3::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::IntVec3::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::IntVec3::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    ::Whms::Void::Type Type::Visit(::Whms::Property::Base::IntVec4::Ref InRef)
                    {
                        ::Whms::Property::Net::Base::IntVec4::Ptr PropertyPtr = ::Wiz::Cast::Static<::Whms::Property::Net::Base::IntVec4::Ptr>(&InRef);

                        if (::Wiz::IsValidPtr(PropertyPtr))
                        {
                            ::Whms::Size::Type szSerialized = PropertyPtr->Serialize(m_Archive);
                            m_SerializedSizeArray.PushBack(szSerialized);
                        }
                    }

                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////
                    //////////////////////////////////////////////////////////////////////////

                } /// end of namespace Base

                ::Wiz::Void::Type Type::MakeParcel(::Whms::Network::Parcel::Array::Out OutPrcls, ::Whms::Property::Array::In InPropArray)
                {
                    m_SerializedSizeArray.Clear();

                    ::Whms::Size::Type i = 0;
                    for (; i < InPropArray.Size(); ++i)
                    {
                        ::Whms::Property::Ptr PropPtr = InPropArray[i];
                        if (::Wiz::IsValidPtr(PropPtr))
                        {
                            PropPtr->Accept(*this);
                        }
                    }
                }
            } // end of namespace Visitor
        } // end of namespace Property
    } /// end of namespace Network
} // end of namespace Whms

